home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 5208 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  946 b 

  1. Path: ix.netcom.com!netnews
  2. From: mchamp@ix.netcom.com (Michael Champagne)
  3. Newsgroups: comp.lang.c++
  4. Subject: Braces and Inline Assembly?
  5. Date: Sat, 03 Feb 1996 00:50:39 GMT
  6. Organization: Netcom
  7. Message-ID: <4eubgp$6ui@ixnews6.ix.netcom.com>
  8. NNTP-Posting-Host: ix-dfw11-17.ix.netcom.com
  9. X-NETCOM-Date: Fri Feb 02  4:50:33 PM PST 1996
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. Ok..  I'm new to using inline assembly and I was wondering why this
  13. compiles:
  14.  
  15. void set_mode(const int mode)
  16. {
  17.   asm  {
  18.     mov AH, 0;
  19.     mov AL, byte ptr mode;
  20.     int 10h;
  21.   }
  22. }
  23.  
  24. and this doesn't..
  25.  
  26. void set_mode(const int mode)
  27. {
  28.   asm
  29.   {
  30.     mov AH, 0;
  31.     mov AL, byte ptr mode;
  32.     int 10h;
  33.   }
  34. }
  35.  
  36. Seems like it's the exact same code..   does the placement of the
  37. braces matter when using the 'asm' statement?  In the second one the
  38. compiler doesn't recognize the 'mov' and says there needs to be a
  39. couple of semicolons stuck in there. 
  40.  
  41. Thanks in advance,
  42.  
  43. Mike
  44.  
  45.  
  46.